package com.qf.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;

/**
 * projectName: redis--Forth
 *
 * @author: MaTianWei
 * time: 2021/7/26 20:26
 * description:
 */


@Data
public class Person {
        @JsonIgnore//json转换的时候忽略这个id
        private String id;
        //姓名
        private String name;
        //年龄
        private Integer age;
        //出生日期, 日期格式必须和ES中这个索引字段的日期格式保持一致
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date birthday;

        public Person(String id, String name, Integer age, Date birthday) {
                this.id = id;
                this.name = name;
                this.age = age;
                this.birthday = birthday;
        }

        public Person() {
        }

        public String getId() {
                return id;
        }

        public void setId(String id) {
                this.id = id;
        }

        public String getName() {
                return name;
        }

        public void setName(String name) {
                this.name = name;
        }

        public Integer getAge() {
                return age;
        }

        public void setAge(Integer age) {
                this.age = age;
        }

        public Date getBirthday() {
                return birthday;
        }

        public void setBirthday(Date birthday) {
                this.birthday = birthday;
        }
}

